import request from '@/utils/request'

// 查询会员表列表
/*export function listMembership(query) {
  return request({
    url: '/membership/membership/list',
    method: 'get',
    params: query
  })
}*/
export function listMembership(query) {
  return request({
    url: '/membership/membership/list',
    method: 'get',
    params: query
  })
}

//查询会员变动记录
export function listvipchangelog(id) {
  return request({
    url: '/membership/selectjilulist/list',
    method: 'get',
    params: {
      id :id
    }
  })
}

// 查询会员表详细
export function getMembership(membershipId) {
  return request({
    url: '/membership/membership/' + membershipId,
    method: 'get'
  })
}

// 新增会员表
export function addMembership(data) {
  return request({
    url: '/membership/membership',
    method: 'post',
    data: data
  })
}
//充值
export function chongzhidialog(formcz){
  return request({
  url: '/membership/recharge/add',
    method: 'post',
    params:{
      patientId: formcz.patientId,
      zengjiaJine: formcz.zengjiaJine,
    }
  })
}

//退款
export function  tuikuandialog(formcz){
  return request({
    url: '/membership/recharge/less',
    method: 'post',
    params: {
      jianshaoJine: formcz.jianshaoJine,
      patientId: formcz.patientId
    }
  })
}


// 修改会员表
export function updateMembership(data) {
  return request({
    url: '/membership/membership',
    method: 'put',
    data: data
  })
}

// 删除会员表
export function delMembership(membershipId) {
  return request({
    url: '/membership/membership/' + membershipId,
    method: 'delete'
  })
}
